Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add isort #474

Closed
wants to merge 1 commit into from
Closed

Add isort #474

wants to merge 1 commit into from

Conversation

Mogost
Copy link
Contributor

@Mogost Mogost commented Jun 19, 2024

@selwin I have applied only isort rules for simplifying the review process.

Also, I have enforced import per line as it is a more merge-friendly format.

@Mogost
Copy link
Contributor Author

Mogost commented Jun 24, 2024

@selwin If you want another configuration let me know

@selwin
Copy link
Collaborator

selwin commented Nov 19, 2024

@Mogost sorry I just saw this. Mind bumping the ruff version used in the workflow file? Also, I'm not a fan of using single line imports, ming removing this?

@Mogost
Copy link
Contributor Author

Mogost commented Nov 19, 2024

Hi @selwin,

Thanks for your feedback! I prefer to stick with single-line imports as they significantly reduce merge conflicts, especially when multiple contributors are working on the same file. They also make diffs clearer by isolating changes to individual imports, which simplifies reviews.

This format does increase the length of import blocks, making source code files longer.
But I find this is a small price to pay for the reduced merge conflicts. And the cost is limited by using editor features, such as “go to definition” for navigation, or PyCharm’s default to “folding” of import blocks. Even if it only prevents a few conflicts per month, I think it’s worth it.

@selwin
Copy link
Collaborator

selwin commented Nov 20, 2024

Thanks for your feedback! I prefer to stick with single-line imports as they significantly reduce merge conflicts, especially when multiple contributors are working on the same file. They also make diffs clearer by isolating changes to individual imports, which simplifies reviews.

I understand your argument and I do acknowledge that merge conflicts will also be reduced. I'm just not ready to move on from my decades old habit of how I see modules are imported in Python 🙏🏻

@Mogost Mogost closed this Nov 20, 2024
@Mogost Mogost deleted the isort branch November 20, 2024 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants